package org.langcom.logic.constraint;

import java.text.MessageFormat;


public enum ConstraintType {

	EQUAL,MORE_OR_EQUAL,LESS_OR_EQUAL, NOT_EQUAL, LESS,MORE;
	
	public  static ConstraintType fromString(String str) {
		if(str.equals("=")) { //$NON-NLS-1$
			return EQUAL;
		}
		if(str.equals(">=")) {//$NON-NLS-1$
			return MORE_OR_EQUAL;
		}
		if(str.equals("<=")) {//$NON-NLS-1$
			return LESS_OR_EQUAL;
		}
		if(str.equals("!=")) {//$NON-NLS-1$
			return NOT_EQUAL;
		}
		if(str.equals("<")) {//$NON-NLS-1$
			return LESS;
		}
		if(str.equals(">")) {//$NON-NLS-1$
			return MORE;
		}
		throw new RuntimeException(MessageFormat.format("Not found equals with {0}", str));//$NON-NLS-1$
	}
}
